/**
 * Copyright 2016-2017 TVI Go Easy.
 * Created on 2017/4/18 14:31
 */
package org.mechanic.fund.domain.product;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.mechanic.fund.domain.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * 产品系列实体类
 *
 * @author mechanic
 * @version 0.0.1
 */
@Entity
@Table(name = "product_type")
//@JsonIgnoreProperties(value = "sort", allowSetters = true)
public class ProductType extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 2806143806137819435L;

    /**
     * 名称
     */
    @Column(name = "name")
    private String name;

    /**
     * 排序序号
     */
    @Column(name = "sort", columnDefinition = "TINYINT(1)")
    private Integer sort;

    /**
     * 产品
     */
    //@OneToMany(cascade = CascadeType.ALL)
    //private Product product;

    public ProductType() {
    }

    public ProductType(
      String name,
      Integer sort) {
        super();
        this.name = name;
        this.sort = sort;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    //public Product getProduct() {
    //    return product;
    //}
    //
    //public void setProduct(Product product) {
    //    this.product = product;
    //}

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
